import AIImg from "../../../assets/chatCard/18.webp";
import GitHub from "../../../assets/chatCard/19.webp";
import Closed from "../../../assets/chatCard/8.webp";
import Link from "../../../assets/sendChat/1.png";
import { AnyObject } from "antd/es/_util/type";
import { memo } from "react";
import "./index.css";
import AIHeader from "./header";
import AIInput from "./AIInput";
const Program = ({ resetIndex }: AnyObject) => {
  return (
    <>
      <div className="rounded-2xl bg-z-black border-gray-black border overflow-hidden relative items-center">
        <AIHeader
          resetIndex={resetIndex}
          img={AIImg}
          Closed={Closed}
          title="AI编程"
        />
        <AIInput
          placeholder="粘贴代码或描述你的问题"
          toolLeft={
            <div className="flex gap-2.5 mt-4">
              <IMGCom icon={Link} text="代码文件" />
              <IMGCom icon={GitHub} text="GitHub 仓库" />
            </div>
          }
        />
      </div>
    </>
  );
};
const IMGCom = memo(({ icon, text }: AnyObject) => {
  return (
    <div className="rounded-lg border border-gray-black py-2 px-3 text-xs  cursor-pointer text-white flex box-border">
      <img src={icon} className="w-4 h-4 mr-1.5" alt="" />
      <div>{text}</div>
    </div>
  );
});

export default Program;
